#ifndef SKYNET_SERVER_H
#define SKYNET_SERVER_H

#include <stdint.h>
#include <stdlib.h>
#include "config_win32.h"
struct skynet_context;
struct skynet_message;
struct skynet_monitor;

SKYNET_API struct skynet_context * skynet_context_new(const char * name, const char * parm);
SKYNET_API void skynet_context_grab(struct skynet_context *);
SKYNET_API void skynet_context_reserve(struct skynet_context *ctx);
SKYNET_API struct skynet_context * skynet_context_release(struct skynet_context *);
SKYNET_API uint32_t skynet_context_handle(struct skynet_context *);
SKYNET_API int skynet_context_push(uint32_t handle, struct skynet_message *message);
SKYNET_API void skynet_context_send(struct skynet_context * context, void * msg, size_t sz, uint32_t source, int type, int session);
SKYNET_API int skynet_context_newsession(struct skynet_context *);
SKYNET_API struct message_queue * skynet_context_message_dispatch(struct skynet_monitor *, struct message_queue *, int weight);	// return next queue
SKYNET_API int skynet_context_total();
SKYNET_API void skynet_context_dispatchall(struct skynet_context * context);	// for skynet_error output before exit

SKYNET_API void skynet_context_endless(uint32_t handle);	// for monitor

SKYNET_API void skynet_globalinit(void);
SKYNET_API void skynet_globalexit(void);
SKYNET_API void skynet_initthread(int m);

#endif
